#ifndef __APEXBRAIN_BATTLEWIDGET_H_
#define __APEXBRAIN_BATTLEWIDGET_H_

#include <QWidget>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QNetworkRequest>
#include <QJsonObject>
#include "global.h"

namespace Ui {
    class BattleWidget;
}

class BattleWidget : public QWidget
{
    Q_OBJECT

public:
    explicit BattleWidget(QWidget *parent = nullptr);
    ~BattleWidget();

protected:
    void closeEvent(QCloseEvent *event) override;

signals:
    void matchSuccess();

private:
    Ui::BattleWidget *ui;
    QNetworkAccessManager *m_networkAccessManager;
    QJsonObject m_opponent;

    void startMatching();
};

#endif // __APEXBRAIN_BATTLEWIDGET_H_
